import { response } from "express";
import { request } from "express";
import StarService from "../../service/starService/starService.js";

class StarController {
    /**
     * @param {request} req
     * @param {response} res
     * post请求
     */
    static async InsertStar(req, res, next) {
        try {
            const { starring, beStarred } = req.body
            const status = await StarService.InsertStar({ starring, beStarred })
            if (status) {
                res.send({
                    msg: '关注成功!',
                    code: 1,
                    data: status
                })
            } else next({
                msg: '关注失败',
                error: status
            })
        } catch (error) {
            next({ error })
        }
    }
    /**
     * 
     * @param {request} req 
     * @param {response} res 
     * @param {Function} next 
     */
    static async DeleteStar(req, res, next) {

    }
}


export default StarController